home *** CD-ROM | disk | FTP | other *** search
- #ifndef __BALLOONS__
- #include <Balloons.h>
- #endif
-
- #ifndef __CTLHANDLER__
- #define __CTLHANDLER__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __EVENTS__
- #include <Events.h>
- #endif
-
- #ifndef __WINDOWS__
- #include <Windows.h>
- #endif
-
- #define kScrollEvent 0x8000
-
-
-
- short IsCtlEvent(WindowPtr window, EventRecord *event, ControlHandle *ctl, short *action);
- /*
- ** INPUT: window Window that owns the controls that the event is to be applied to
- ** event The event to apply to the controls
- ** OUTPUT: ctl The control that ate the event. If you don't care, pass in nil
- ** action The action of the control that ate the event. If you don't
- ** care, pass in nil. Note that the action varies with the control
- ** type.
- ** RESULT: short The control ID of the control that ate the event. If no control
- ** ate the event, then 0 is returned. If a document scrollbar ate
- ** the event, then kScrollEvent is returned.
- **
- ** See the file “=Using CtlHandler.c” for a complete description of this function.
- */
-
-
-
- short CNum2Ctl(WindowPtr window, short ctlNum, ControlHandle *ctl);
- /*
- ** INPUT: window Window that owns the control list to be scanned.
- ** ctlNum ID of the control to search for.
- ** OUTPUT: ctl If a control is found with the correct ID, it is returned here.
- ** RESULT: short ID of found control (archaic)
- **
- ** AppsToGo extends the control record. This means that, among other things, controls
- ** can have a fixed control ID. If a control has a style, and the ctlID field if the
- ** style is non-zero, then that control has a fixed control ID. Due to this, CNum2Ctl
- ** first scans all of the controls for a control with a style that has the designated
- ** ctlID. If one is found, then that's the control returned. If none is found, then
- ** the behavior for this function is as before (for the purpose of backwards-compatibility).
- **
- ** The way that this function used to work is:
- **
- ** It simply walks the window's control list counting down until it has reached
- ** the right control number. It also returns the number of controls traversed.
- ** While often this will be the same as the control number passed in, if the
- ** number passed in is greater than the number of controls in the list, then
- ** the number returned is the number of controls in the list.
- */
-
-
-
- short Ctl2CNum(ControlHandle ctl);
- /*
- ** INPUT: ctl Control handle to convert to an ID.
- ** RESULT: short The ID of the control passed in.
- **
- ** This function converts a control handle to a control number. This allows you to convert
- ** what is normally a runtime variable into something that can be equated to a constant,
- ** thus allowing you to code your control handling into case statements. This function
- ** does the opposite of CNum2Ctl. */
-
-
-
- void DoCtlActivate(WindowPtr window);
- /*
- ** INPUT: window Window whose TextEdit or List control is to be reactivated
- **
- ** This reactivates the TextEdit or List control that was active for a particular window.
- ** When a window is moved from the front, the controls are supposed to become inactive.
- ** This is handled, but the control that was last active for a window is remembered.
- ** When the window is brought to the front, that particular control can be reactivated
- ** by calling DoCtlActivate(). */
-
-
-
- void GetCheckBoxValues(WindowPtr window, Boolean checkBoxVal[]);
- /*
- ** INPUT: window Window whose control list is to be scanned for
- ** checkBox controls.
- ** OUTPUT: checkBoxVal An array that is to receive the value of the checkBox
- ** controls in the windowList. It is the caller's
- ** responsibility to guarantee that the array is large enough.
- ** This function will use one array element for every
- ** checkBox control found in the control list of the window.
- */
-
-
-
- short GetRadioButtonChoice(WindowPtr window, short famNum);
- /*
- ** INPUT: window Window containing the family of radio buttons.
- ** famNum The family number of the radio buttons.
- ** RESULT: short Which radio button in the family that is selected.
- **
- ** Given a particular family number, return which radio button is the currently selected
- ** button. If the requested family isn't found, or there are no selected radio buttons
- ** in the family, -1 is returned. If the family is found, the control number of the the
- ** selected radio button minus the control number of the first in the family is returned.
- ** ••• The first in the family is the control with the smallest ID. •••
- ** This means that for most situations, you will simply get an integer from 0-N for the
- ** radio button selection, as in most cases, the radio button ID's will be sequential in
- ** the control list. */
-
-
-
- ControlHandle CDataNext(WindowPtr window, ControlHandle ctl);
- /*
- ** INPUT: window Window containing control list to scan.
- ** ctl Control to start search from (nil for beginning of list)
- ** RESULT: ControlHandle Next data control in list (nil indicates no more in list)
- **
- ** When a set of controls defined with the AppsToGo editor is added to a window, an
- ** additional Data control is also added. The purpose of the Data control is to keep
- ** track of which controls were added as a set of controls. (The Data control "groups"
- ** the set of controls.) CDataNext allows you to get the next data control out of the
- ** window's control list. (Normally you won't need this function.) */
-
-
-
- Boolean ControlBalloonHelp(WindowPtr window, short modifiers, Point mouseLoc);
- /*
- ** INPUT: window Window containing controls that may have balloon help info.
- ** modifiers This is in case the application is using fast balloons.
- ** mouseLoc Current mouse location, in global coordinates.
- ** RESULT: Boolean True if a balloon was displayed.
- **
- ** This function is actually in Help.c, but it is specifically for managing
- ** balloon help for controls. IsCtlEvent calls it, although you can call it
- ** yourself, if you want. (There shouldn't be any reason for an application
- ** to call this directly. */
-
-
-
- ControlHandle ControlBalloonMessage(WindowPtr window, Point mouseLoc, HMMessageRecord *msg,
- Rect *msgRct, short *pos, short *hrctID, short *itemID);
- /*
- ** INPUT: window Window containing controls that may have balloon help info.
- ** mouseLoc
- ** OUTPUT: msg The Balloon Help message record. This is what should be
- ** displayed in the balloon.
- ** msgRct The rect of the control the help message relates to.
- ** pos The balloon position.
- ** hrctID The 'hrct' resource ID.
- ** itemID The 'hrct' resource item ID.
- ** RESULT: ControlHandle The control the help is for. */
-
-
-
- PicHandle BalloonText2PICT(WindowPtr window, HMMessageRecord *msg);
- /*
- ** INPUT: window Window that the balloon help is for.
- ** msg The Balloon Help message record. (May or may not be a text record.)
- ** RESULT: PicHandle If the Balloon Help record is text, then a PicHandle is created
- ** that contains the text.
- ** This function converts a Balloon Help text message into a PicHandle. This is because
- ** Balloon Help only automatically works for text strings less than 255 characters.
- ** Longer balloons need to be done with the PICT resource type. This function converts
- ** text messages into a PICT so that long text can be used without having to create
- ** a PICT. */
-
- #endif
-